<!--
 * @Author: jhw
 * @Date: 2025-08-05 10:22:40
 * @LastEditors: jhw
 * @LastEditTime: 2025-08-05 17:20:24
 * @Description:
-->
<template>
  <ButtonGroup :title="showName" :status="status[currentStatus]">
    <el-button-group>
      <el-button
        :class="{
          select: currentStatus === 0,
        }"
        @click="changeSize(0)"
      >
        <font-awesome-icon size="lg" icon="fa-solid fa-bold" />
      </el-button>
      <el-button
        :class="{
          select: currentStatus === 1,
        }"
        @click="changeSize(1)"
      >
        <font-awesome-icon size="sm" icon="fa-solid fa-bold" />
      </el-button>
    </el-button-group>
  </ButtonGroup>
</template>

<script setup lang="ts">
import type { UpdateStatus, VueComType } from '@/types';
import ButtonGroup from './ButtonGroup.vue';
import { inject } from 'vue';

const props = defineProps<{
  currentStatus: number;
  status: string[];
  isShow: boolean;
  configKey: string;
  editCom: VueComType;
  showName?: string;
}>();
const updateStatus = inject<UpdateStatus>('updateStatus');
const changeSize = (pos: number) => {
  updateStatus?.(props.configKey, pos);
};
</script>

<style scoped></style>
